package Cy.Servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import Cy.DAO.IntegralDAO;
import Entity.Integral;
import Factory.IntegralFactory;

/**
 * Servlet implementation class SelectupdateintegralServlet
 */
@WebServlet("/selectupdateintegral")
public class SelectupdateintegralServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private IntegralDAO integralDAO = IntegralFactory.createDAO();
	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		response.setContentType("text/html;charset=utf-8");
		try{
			int iid = Integer.parseInt(request.getParameter("iid"));
			request.setAttribute("iid", iid);
		}catch(Exception e){
			
		}
		List<Integral> list = integralDAO.selectiname();
		request.setAttribute("list", list);
		request.getRequestDispatcher("updateIntegral.jsp").forward(request, response);
	}

}
